Component({
  properties: {
    text: {
      type: String,
      value: '按钮',
    },
    type: {
      type: String,
      value: 'primary', // primary, success, error
    },
    disabled: {
      type: Boolean,
      value: false,
    },
    loading: {
      type: Boolean,
      value: false,
    },
    size: {
      type: String,
      value: 'normal', // small, normal, large
    },
    block: {
      type: Boolean,
      value: false,
    },
  },

  data: {},

  methods: {
    onClick() {
      if (this.data.disabled || this.data.loading) return
      this.triggerEvent('click')
    },
  },
})
